package com.xm.listener;

import com.xm.model.Msg;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class FanoutReceiver {

    @RabbitListener(queues = "fanout.A")
    @RabbitHandler
    public void processA(Msg msg){
        log.info("fanoutReceiver[{}](processA)消费者收到消息：{}", 1, msg);
    }

    @RabbitListener(queues = "fanout.B")
    @RabbitHandler
    public void processB(Msg msg){
        log.info("fanoutReceiver[{}](processB)消费者收到消息：{}", 1, msg);
    }

    @RabbitListener(queues = "fanout.C")
    @RabbitHandler
    public void processC(Msg msg){
        log.info("fanoutReceiver[{}](processC)消费者收到消息：{}", 1, msg);
    }
}
